﻿/**
 * Project SEM 2 - SMS for schools
 * File author:ToanMH
 * Datetime create:14/11/2010
 * File version:1.0
 * File description:
 * 
 * Modify history:
 * 
 */
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Management;
using System.Diagnostics;
using System.Threading;

namespace sms_modem_control
{
    public partial class Setting : Form
    {
        public Setting()
        {

            InitializeComponent();
        }	
        private void Setting_Load(object sender, EventArgs e)
        {
            
       }

        private SystemUtilities usage = new SystemUtilities();
        Process currentProc = Process.GetCurrentProcess();
        private void timer1_Tick(object sender, EventArgs e)
        {
            richTextBox1.Text = "";

            string memT = String.Empty;
            try
            {
                short cpuUsage = usage.GetUsage();
                UIUtilities.AppendRichTextBox(richTextBox1,Color.Red,cpuUsage+"% cpu usage\n");
                UIUtilities.AppendRichTextBox(richTextBox1, Color.Red, (currentProc.PrivateMemorySize64/1024) + " kb RAM usage");
            }
            catch (Exception)
            {
            }
        }


    }
}
